const { info } = require("../utils/log_tool");
const { BaseCommand } = require("./base");

class SwitchCommand extends BaseCommand {
    async execute() {
        const commands_cfg = await this.forward("select", {
            content: this.selfData.commands_cfgs,
            preview: "title",
            quiet: true,
        });
        info(`执行命令 ${commands_cfg.title}`);
        await this.exec(commands_cfg.commands);
    }
}

module.exports = {
    SwitchCommand,
};
